<?php

namespace App\Services\Business;

use App\Services\ProjectValidate;

/**
 * 业务验证
 * Class ValidateSetting
 * @package App\Services\Business
 */
class ValidateBusiness extends ProjectValidate
{

    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
        if (!empty($initData['requiredId'])) {
            $this->rules['id']  = 'required|int|min:1';
        }
    }


    /**
     * @var array 验证规则集合
     */
    public $rules = [
        'id'          => 'required',
        'company_name'=> 'required|min:1|max:50',
        'phone_name'  => 'required|min:1|max:10',
        'address'   => 'required|min:1',
        'phone'    => 'required|min:2|max:30',
        'code' => 'required|min:2|max:30',
        'company_image'     => 'required',
    ];

    /**
     * @var array 当前验证错误信息
     */
    public $messages = [

    ];
}